import {request1, request2} from './request.js';

export function getMenusList() {
  return request1({
    url: '/menus'
  })
}

export function getUserList() {
  return request1({
    url: '/users',
    params: {
      query: '',
      pagenum: 1,
      pagesize: 2
    }
  })
}

export function getHomeData(method, type="get") {
  if(type ==="get") {
    const {url, params} = method;
    return request1({
      method: type,
      url,
      params
    })
  }else {
    const {url, data} = method;
    return request1({
      method: type,
      url,
      data
    })
  }
}

export function getHomeData2(method, type="get") {
  if(type ==="get") {
    const {url, params} = method;
    return request1({
      method: type,
      url,
      params
    })
  }else {
    const {url, data} = method;
    return request1({
      method: type,
      url,
      data
    })
  }
}
export function getHomeData3(method, type="get") {
  if(type ==="get") {
    const {url, params} = method;
    return request2({
      method: type,
      url,
      params
    })
  }else {
    const {url, data} = method;
    return request2({
      method: type,
      url,
      data
    })
  }
}